package cn.zhx.domain.strategy.service.armory;

import java.util.Date;

/**
 * @Author: zhx
 * @Date: 2024/07/03
 * @Description: 策略抽奖调度
 **/
public interface IStrategyDispatch {
    /**
     * 获取抽奖策略装配的随机结果
     *
     * @param strategyId 策略ID
     * @return 奖品id
     */
    Integer getRandomAwardId(Long strategyId);

    /**
     * 获取抽奖策略装配的随机结果(带权重)
     * @param strategyId 策略ID
     * @param ruleWeightValue  权重 '4000:102,103,104,105'
     * @return 奖品id
     */
    Integer getRandomAwardId(Long strategyId, String ruleWeightValue);

    /**
     * 扣减库存
     * @param strategyId 策略ID
     * @param awardId 奖品ID
     * @param endDateTime 活动截止时间
     * @return 扣减结果
     */
    Boolean subtractAwardCount(Long strategyId, Integer awardId,Date endDateTime);

}
